var popup_menu = null;
document.onclick = new Function("showPopupMenu(null)")
function getPos(el,sProp) {
	var iPos = 0;
	while (el!=null) {
		iPos+=el["offset" + sProp];
		el = el.offsetParent;
	}
	return iPos;
}

function showPopupMenu(el, m, user) {
	if (m) {
		m.style.display='';
		m.style.pixelLeft = getPos(el,"Left") + el.offsetWidth;
		m.style.pixelTop = getPos(el,"Top");
		m.innerHTML  = "<a href=" + encodeURI("sendmsg.php?to=" + user) + " class=cla2>发小纸条</a><br>";
		m.innerHTML += "<a href=" + encodeURI("index.php?m=member&a=view&id=" + user) + " class=cla2 target=\"member\">个人信息</a>";
	}
	if ((m!=popup_menu) && (popup_menu)) popup_menu.style.display = 'none';
	popup_menu = m;
}

function hidePopupMenu(el, m) {
	if (el && m && m.style.display=='') {
		if ((document.body.scrollLeft + window.event.x > el.offsetLeft) 
				&& (document.body.scrollLeft + window.event.x < el.offsetLeft + el.offsetWidth) 
				&& (document.body.scrollTop + window.event.y > el.offsetTop) 
				&& (document.body.scrollTop + window.event.y < el.offsetTop + el.offsetHeight)
				|| (document.body.scrollLeft + window.event.x > m.offsetLeft)                
				&& (document.body.scrollLeft + window.event.x < m.offsetLeft + m.offsetWidth) 
				&& (document.body.scrollTop + window.event.y > m.offsetTop)
				&& (document.body.scrollTop + window.event.y < m.offsetTop + m.offsetHeight)) {
		} else {
			m.style.display = 'none';
		}
	}
}

function hideSelf(m) {	
	if (m.style.display=='') {
		if ((document.body.scrollLeft + window.event.x >= m.offsetLeft)                
		&& (document.body.scrollLeft + window.event.x <= m.offsetLeft + m.offsetWidth) 
		&& (document.body.scrollTop + window.event.y >= m.offsetTop)
		&& (document.body.scrollTop + window.event.y <= m.offsetTop + m.offsetHeight)) {
		} else {
			m.style.display = 'none';
		}
	}
}

function dn() {
	return;
}
